package com.binfenhulian.chinaenergy.ces.manage.framework.filter;

import org.sitemesh.SiteMeshContext;
import org.sitemesh.content.ContentProperty;
import org.sitemesh.content.tagrules.TagRuleBundle;
import org.sitemesh.content.tagrules.html.ExportTagToContentRule;
import org.sitemesh.tagprocessor.State;

/**
 * Created by wanghjbuf on 2018/3/8.
 */
public class CustomTagRuleBundle implements TagRuleBundle {

    @Override
    public void install(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {
        defaultState.addRule("m-content", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("m-content"), false));
        defaultState.addRule("m-script", new ExportTagToContentRule(siteMeshContext, contentProperty.getChild("m-script"), false));
    }

    @Override
    public void cleanUp(State defaultState, ContentProperty contentProperty, SiteMeshContext siteMeshContext) {

    }
}
